From 9c2304361f829a8f0a28460ea8f14bebd00b2939 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 28 Apr 2023 14:43:19 +0700
Subject: category

---
 src/pages/shop/category/[slug].jsx | 40 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 src/pages/shop/category/[slug].jsx

(limited to 'src/pages/shop/category/[slug].jsx')

diff --git a/src/pages/shop/category/[slug].jsx b/src/pages/shop/category/[slug].jsx
new file mode 100644
index 00000000..2c5d9f3e
--- /dev/null
+++ b/src/pages/shop/category/[slug].jsx
@@ -0,0 +1,40 @@
+import dynamic from 'next/dynamic'
+import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug'
+import { useRouter } from 'next/router'
+import _ from 'lodash'
+import Seo from '@/core/components/Seo'
+
+const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
+const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch'))
+
+export default function CategoryDetail() {
+  const router = useRouter()
+  const { slug = '' } = router.query
+
+  const categoryName = getNameFromSlug(slug)
+  const categoryId = getIdFromSlug(slug)
+  const query = {
+    fq: `manufacture_id_i:${categoryId}`
+  }
+  return (
+    <BasicLayout>
+      <Seo
+        title={`Beli ${categoryName} di Indoteknik`}
+        description={`Jual ${categoryName} Kirim Jakarta Surabaya Semarang Makassar Manado Denpasar Balikpapan Medan Palembang Lampung Bali Bandung Makassar Manado.`}
+        additionalMetaTags={[
+          {
+            property: 'keywords',
+            content: `Jual ${categoryName}, harga ${categoryName}, ${categoryName} murah, toko ${categoryName}, ${categoryName} jakarta, ${categoryName} surabaya`
+          }
+        ]}
+      />
+
+      {!_.isEmpty(router.query) && (
+        <ProductSearch
+          query={query}
+          prefixUrl={`/shop/category/${slug}`}
+        />
+      )}
+    </BasicLayout>
+  )
+}
-- 
cgit v1.2.3


From b4abdb00ef83aa824e8a05d5b75df48adb7b9629 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 3 May 2023 10:38:52 +0700
Subject: semi dynamic page

---
 src/pages/shop/category/[slug].jsx | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'src/pages/shop/category/[slug].jsx')

diff --git a/src/pages/shop/category/[slug].jsx b/src/pages/shop/category/[slug].jsx
index 2c5d9f3e..dbc17c06 100644
--- a/src/pages/shop/category/[slug].jsx
+++ b/src/pages/shop/category/[slug].jsx
@@ -30,10 +30,7 @@ export default function CategoryDetail() {
       />
 
       {!_.isEmpty(router.query) && (
-        <ProductSearch
-          query={query}
-          prefixUrl={`/shop/category/${slug}`}
-        />
+        <ProductSearch query={query} prefixUrl={`/shop/category/${slug}`} />
       )}
     </BasicLayout>
   )
-- 
cgit v1.2.3

